package com.cheems.controller;

import com.cheems.entity.Result.Result;
import com.cheems.entity.DTO.pageParamsDTO;
import com.cheems.entity.Pojo.picClassify;
import com.cheems.service.PicClassifyService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@Api(tags = "分类相关接口")
public class PicClassifyController {
    @Autowired
    private PicClassifyService picClassifyService;

    /**
     * 获得壁纸大分类
     * @return
     */
    @PostMapping("/classify")
    public Result<List<picClassify>> PicClassify(@RequestBody pageParamsDTO pageParamsDTO){
        log.info("获取分类大图,{}",pageParamsDTO);
        List<picClassify> picClassifyList = picClassifyService.PicClassify(pageParamsDTO);
        return Result.success(picClassifyList);
    }
}
